# $Id: PKGBUILD 149475 2012-02-08 09:53:00Z pierre $
# Maintainer: kevin <kevin@archlinux.org>
# Contributor: phrakture <aaronmgriffin+gmail+com>
# Contributor: SpepS <dreamspepser at yahoo dot it>

# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
#  - patch to fix x86-only parts

pkgname=cpufrequtils
pkgver=008
pkgrel=2
pkgdesc="Userspace tools for the kernel cpufreq subsystem"
arch=('i686' 'x86_64')
url="http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html"
license=('GPL')
depends=('sysfsutils')
backup=('etc/conf.d/cpufreq')
source=("ftp://ftp.archlinux.org/other/${pkgname}/${pkgname}-${pkgver}.tar.bz2"
        'cpufreq.rcd'
        'cpufreq.confd'
        '0001-Only-x86-has-cpuid-instruction.patch')
options=('!libtool' '!makeflags')
md5sums=('c59b71c044d463896f3247e8dd83dd7e'
         '7f2b5085df44d2df3e7c2d0b9f6dab08'
         'baae1f2abffc6bef2bd32a8dd8263c09'
         '9ed71a50670aa99e12245cb3f5199142')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  patch -p1 -i "${srcdir}/0001-Only-x86-has-cpuid-instruction.patch"

  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make INSTALL="/usr/bin/install -c" mandir=/usr/share/man DESTDIR="${pkgdir}" install

  install -D -m755 ${srcdir}/cpufreq.rcd "${pkgdir}/etc/rc.d/cpufreq"
  install -D -m644 ${srcdir}/cpufreq.confd "${pkgdir}/etc/conf.d/cpufreq"
}
